//
//  FBFindorderModel.m
//  XTXOneToOne
//
//  Created by Canny on 2018/11/6.
//  Copyright © 2018年 WK. All rights reserved.
//

#import "FBFindorderModel.h"

@implementation FBFindorderTool

+(FBPayOrderVCOrderStatusType)GetTypeWithSatus:(NSInteger)status{
    if (status == 0) {
        return FBPayOrderVCOrderStatusType_Status_0;////待付款
    }else if (status == 1){
        return FBPayOrderVCOrderStatusType_Status_1;////已付款（未释放代币）
    }else if (status == 2){
        return FBPayOrderVCOrderStatusType_Status_2;////已释放代币
    }else if (status == 3){
        return FBPayOrderVCOrderStatusType_Status_3;////已完成
    }else {
        return FBPayOrderVCOrderStatusType_Status_4;////已取消
    }

}

+(NSString *)GetStatusName:(NSString *)status andPayType:(NSString *)pay_type{
    
    if ([status integerValue]==0) {
        return  @"待付款";
    }else if ([status integerValue]==1){

        return @"等待放币";
    }else if ([status integerValue]==2){
        return @"已释放代币";
    }else if ([status integerValue]==3){
        return @"已完成";
    }else{
        return @"已取消";
    }
}

+(BOOL)GetBugStatusWithModel:(FBFindorderModel *)model{
   
    NSString * userId1 = [LoginModel GetValue:DL_user_id];
    NSString * userId2 = model.bill_user_id;
    
    if ([model.order_type  integerValue]==1) {
        if ([userId1 integerValue]==[userId2 integerValue]) {
            //当前登录用户的广告 -- 出售页面
            return NO;//出售
        }else{
            //不是当前用户的广告 -- 购买页面
            return YES;
        }
    }else{
        if ([userId1 integerValue]==[userId2 integerValue]) {
            //当前登录用户的广告 -- 购买页面
            return YES;//购买
        }else{
            //不是当前用户的广告 -- 出售页面
            return NO;
        }
    }
    
    
        
}

@end

@implementation FBFindorderPaymentModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
};
+ (NSDictionary *)mj_replacedKeyFromPropertyName
{
    return @{@"ID": @"id"};
}



@end


@implementation FBFindorderModel
+ (NSDictionary *)mj_replacedKeyFromPropertyName
{
    return @{@"ID": @"id"};
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
};

+(NSDictionary *)objectClassInArray
{
    return @{
             @"payment" : [FBFindorderPaymentModel class]
             };
}
@end


@implementation FBFindorderUnReadOrder
singleton_m(FBFindorderUnReadOrder)
@end

